package com.itheima.consumer.controller;

import com.itheima.consumer.domain.Goods;
import com.itheima.consumer.feign.GoodsFeignClients;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("consumer")
public class GoodController {
    @Autowired
    private GoodsFeignClients goodsFeignClients;

    @GetMapping("/goods/{id}")
    public Goods findOne(@PathVariable("id") String id){

        return goodsFeignClients.findOne(id);
    }

}
